//
//  Global.m
//  ez.Coupon
//
//  Created by Nam Le on 1/2/14.
//  Copyright (c) 2014 iOS Team. All rights reserved.
//

#import "Global.h"

@implementation Global

//Nam Le - 1st Jan 2014
bool gIsIPad;

NSString *URL_WS = @"http://nready.net";

+(void) alertMessage:(NSString*) _title message:(NSString*) _message
{
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:_title
													message:_message
												   delegate:self
										  cancelButtonTitle:@"OK"
										  otherButtonTitles:nil, nil];
	[alert show];
	//[alert release];
}

+ (NSString*) xmlEncode:(NSString*)_text
{
    NSString* encode = [_text stringByReplacingOccurrencesOfString:@"&" withString:@"&amp;"];
    encode = [encode stringByReplacingOccurrencesOfString:@"<" withString:@"&gt;"];
    encode = [encode stringByReplacingOccurrencesOfString:@">" withString:@"&lt;"];
    encode = [encode stringByReplacingOccurrencesOfString:@"\"" withString:@"&quot;"];
    encode = [encode stringByReplacingOccurrencesOfString:@"\'" withString:@"&apos;"];
    
    //[encode retain];
    return encode;
}

+ (NSString*) viewOnDevice:(NSString*) iPadDevice : (NSString*) iPhoneDevice
{
    if (gIsIPad)
        return iPadDevice;
    
    return iPhoneDevice;
}
@end
